package com.vae.virtualanimationexperiment.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vae.virtualanimationexperiment.domain.ResponseResult;
import com.vae.virtualanimationexperiment.domain.entity.Info;
import com.vae.virtualanimationexperiment.mapper.InfoMapper;
import com.vae.virtualanimationexperiment.service.InfoService;
import org.springframework.stereotype.Service;

/**
 * (Info)表服务实现类
 *
 * @author makejava
 * @since 2023-03-06 22:01:55
 */
@Service("infoService")
public class InfoServiceImpl extends ServiceImpl<InfoMapper, Info> implements InfoService {

    @Override
    public ResponseResult updateInfo() {
        Info info = getById(1);
        info.setVisitNum(info.getVisitNum() + 1);
        updateById(info);
        return ResponseResult.okResult();
    }

    @Override
    public ResponseResult getInfo() {
        Info info = getById(1);
        return ResponseResult.okResult(info);
    }
}

